package com.walker.controller.catalogue;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.walker.anno.ResponseResult;
import com.walker.service.catalogue.CatalogueFuncService;

import net.sf.json.JSONObject;

/**
 * 资产-目录-函数
 */
@RestController
@RequestMapping(value = "/catalogueFunc")
@ResponseResult
public class CatalogueFuncController {

	@Resource
	private CatalogueFuncService service;
	
	/**
	 * 函数列表
	 * @param request
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@PostMapping("queryFuncList")
	public Map<String, Object> queryFuncList(@RequestBody String request) {
		Map<String, Object> params = JSONObject.fromObject(request);
		return service.queryFuncList(params);
	}
	
	/**
	 * 函数类型信息
	 * @return
	 */
	@PostMapping("queryFuncClassify")
	public List<Map<String, Object>> queryFuncClassify() {
		return service.queryFuncClassify();
	}
	
	/**
	 * 函数详情信息
	 * @return
	 */
	@PostMapping("queryFuncDetail")
	public Map<String, Object> queryFuncDetail(@RequestBody String id) {
		return service.queryFuncDetail(id);
	}
}